package main

import (
	"fmt"
	"reflect"
)

func reflectSetValue1(x interface{}) {
	v := reflect.ValueOf(x)
	if v.Elem().Kind() == reflect.Int64 {
		v.Elem().SetInt(64)
	} else if v.Elem().Kind() == reflect.String {
		v.Elem().SetString("hello golang")
	}
}

func main() {
	var a int64 = 10
	reflectSetValue1(&a)
	fmt.Println(a)

	var b string = "hello"
	reflectSetValue1(&b)
	fmt.Println(b)
}
